package v1

import (
	"devops-super/api"
	"devops-super/internal/model/entity"
	"devops-super/internal/model/mymodel"
	"github.com/gogf/gf/v2/frame/g"
)

// AlertPeopleGetPageLstReq 分页获取告警人员列表请求
type AlertPeopleGetPageLstReq struct {
	g.Meta `method:"get" path:"/alert-people/page-list" summary:"分页获取告警人员列表" tags:"告警人员"`
	*api.PageLstReq
	Name     string `json:"name" description:"姓名"`
	DeptId   uint64 `json:"deptId" description:"所属部门"`
	Phone    string `json:"phone" description:"手机"`
	Email    string `json:"email" description:"邮箱"`
	Language string `json:"language" description:"使用语言"`
}

// AlertPeopleGetPageLstRes 获取告警人员列表响应
type AlertPeopleGetPageLstRes struct {
	*api.PageLstRes[*mymodel.AlertPeopleResponse] // 告警人员列表响应
}

// AlertPeopleAddReq 新增告警人员请求
type AlertPeopleAddReq struct {
	g.Meta `method:"post" path:"/alert-people" summary:"新增告警人员" tags:"告警人员"`
	*mymodel.AlertPeople
}

// AlertPeopleAddRes 新增告警人员响应
type AlertPeopleAddRes struct{}

// AlertPeopleUptReq 更新告警人员请求
type AlertPeopleUptReq struct {
	g.Meta `method:"put" path:"/alert-people/{id}" summary:"更新告警人员" tags:"告警人员"`
	Id     int `v:"min:1#告警人员ID必须" path:"id"`
	*mymodel.AlertPeople
}

// AlertPeopleUptRes 更新告警人员响应
type AlertPeopleUptRes struct{}

// AlertPeopleUptStatusReq 更新告警人员状态请求
type AlertPeopleUptStatusReq struct {
	g.Meta `method:"patch" path:"/alert-people/{id}/status" summary:"更新告警人员状态" tags:"告警人员"`
	Id     int `v:"min:1#告警人员ID必须" path:"id"`
	Status int `v:"required" json:"status"`
}

// AlertPeopleUptStatusRes 更新告警人员状态响应
type AlertPeopleUptStatusRes struct{}

// AlertPeopleDelReq 删除告警人员请求
type AlertPeopleDelReq struct {
	g.Meta `method:"delete" path:"/alert-people/{id}" summary:"删除告警人员" tags:"告警人员"`
	Id     int `v:"min:1#告警人员ID必须" path:"id"`
}

// AlertPeopleDelRes 删除告警人员响应
type AlertPeopleDelRes struct{}

// AlertPeopleGetOneReq 获取一条告警人员信息请求
type AlertPeopleGetOneReq struct {
	g.Meta `method:"get" path:"/alert-people/getOne" summary:"获取一条告警人员信息" tags:"告警人员"`
	Id     int `v:"min:1#告警人员ID必须" path:"id"`
}

// AlertPeopleGetOneRes 获取一条告警人员信息响应
type AlertPeopleGetOneRes struct {
	Info *entity.AlertPeople `json:"info"`
}

// AlertPeopleGetOptionsReq 获取告警人员选项请求
type AlertPeopleGetOptionsReq struct {
	g.Meta     `method:"get" path:"/alert-people/getOptions" summary:"获取告警人员选项" tags:"告警人员"`
	FieldKey   string `json:"fieldKey"`   //明确指出key的字段
	FieldLabel string `json:"fieldLabel"` //明确指出label的字段
	DeptId     uint64 `json:"deptId"`
}

// AlertPeopleGetOptionsRes 获取告警人员选项响应
type AlertPeopleGetOptionsRes struct {
	Options []*api.FormOptionsItem `json:"options"`
}
